<!--
title: 第三方库
description: 
published: true
date: 2025-07-02T07:20:44.842Z
tags: 
editor: ckeditor
dateCreated: 2025-07-02T07:20:44.842Z
-->

<h1>导入第三方库</h1>
<p>&nbsp;</p>
<pre><code class="language-plaintext"># 获取字典
sdk_import_lib(name, package=None, source_url="https://mirrors.aliyun.com/pypi/simple/")</code></pre>
<p>&nbsp;</p>
<ul>
  <li>参数说明<br>name：包名<br>package：pip install XXX的 “XXX"名称,如果为None侧用name的值.<br>source_url：下载源,默认是"阿里云"</li>
</ul>
<p>&nbsp;</p>
<h2>简单示例</h2>
<p>&nbsp;</p>
<pre><code class="language-plaintext"># 导入第三方库SDK
global sdk_import_lib, log_print

# 引入第三方库
nmap = sdk_import_lib("nmap", package="python-nmap")

# 打印库信息
log_print(str(nmap), "INFO")

return str(nmap)</code></pre>
<p>&nbsp;</p>
